package cn.hr.service.impl;

import cn.hr.dao.mapper.SysPermissionMapper;
import cn.hr.pojo.SysPermission;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by MO on 2018/12/25.
 */
@CacheConfig(cacheNames = "sysPermission")
@Scope("prototype")
@Service("permissionService")
public class SysPermissionService {
    @Resource
    private SysPermissionMapper permissionMapper;

    @Cacheable(keyGenerator = "keyGenerator")
    public SysPermission findById(int id) throws Exception {
        return permissionMapper.findById(id);
    }
}
